const path = require('path');
const BuildHtml = require('./BuildHtml.js');
const VueLoad = require('./VueLoad.js');
const HotReload = require('./HotReload.js');
const CopyPlugin = require('copy-webpack-plugin');

module.exports = {
  target: 'web',
  mode: 'development',
  devServer: {
    static: {
      directory: path.join(__dirname, '../src'),
    },
    hot: true,
    port: 8803,
    // open: true,
  },
  entry: {},
  output: {
    path: path.resolve(__dirname, '../dist'),
  },
  plugins: [
    ...BuildHtml(),
    new VueLoad(),
    new HotReload(),
    new CopyPlugin({
      patterns: [
        { from: 'src/css', to: 'css' },
        { from: 'src/images', to: 'images' },
        { from: 'src/lib', to: 'lib' },
        { from: 'src/js', to: 'js' },
      ],
    }),
  ],
};
